  public static void inOrder(TreeNode root){
        TreeNode temp;
        Stack<TreeNode>  s= new Stack<>();
        s.add(root);
        while(!s.empty()) {
            temp = s.peek();
            while(temp.left!=null){
                s.add(temp.left);
                temp = temp.left;
            }
            while(!s.empty()){
                temp = s.pop();
                System.out.println(temp.val);
                if(temp.right != null){
                    s.add(temp.right);
                    break;
                }
            }
        }
    }